package com.twu.biblioteca;

/**
 * Created by sravanns on 20/06/14.
 */
public class Profile implements MenuAction{
    private  Library library;
    private  UIApplication uiApplication;

    public Profile(Library library,UIApplication uiApplication)
    {
        this.library=library;
        this.uiApplication=uiApplication;


    }

    @Override
    public String toString() {
        return "Profile";
    }



    @Override
    public Result performAction(String user) throws Exception {
        Result result=new Result();
        if(uiApplication.display(library.getUserProfile(user)))
        {
            result.setResult("user profile printing", true);
            return result;
        }
        result.setResult("profile invalid",false);
        return result;
    }
}
